package com.tangfuzhong.test;

import com.tangfuzhong.config.Config10_Circular_test;
import com.tangfuzhong.service2.CircularTest2Service;
import com.tangfuzhong.service2.CircularTestService;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class IOCTest_CircularBean {

	//测试循环依赖
	@Test
	public void test01(){
		AnnotationConfigApplicationContext applicationContext  = new AnnotationConfigApplicationContext(Config10_Circular_test.class);


		CircularTestService circularTestService = applicationContext.getBean(CircularTestService.class);
		CircularTest2Service circularTest2Service = applicationContext.getBean(CircularTest2Service.class);
		System.out.println(circularTestService);
		System.out.println(circularTest2Service);

		applicationContext.close();
	}

}
